<template>
	<!--回单跟踪-->
	<div>
		<view style="position: relative;display: flex;flex-direction: row;align-items: center;padding: 12px 10px;font-weight: 400;">
			<view style="width: 4px;height: 12px;border-radius: 10px;background-color: #2979ff;margin-right: 6px"></view>
			<view style="display: flex;flex-direction: column;flex: 1;color: #333;">回单跟踪</view>
		</view>
		<view v-if="list.length>0">
			<view v-for="(item,index) in list" :key="index" style="background-color: #ffffff;margin: 10px;border-radius: 12px;padding: 15px;">
				<view>网点/部门：{{item.deptName}}</view>
				<view>回单要求：拍照回传(签名、公章)</view>
				<view>上传人：{{item.createBy}}</view>
				<view>回单附件：<myfilepicker readonly :fileIdString="item.receiptAttachments" :fileMediatype="'image'"></myfilepicker></view>
				<view>上传时间：{{item.createTime}}</view>
			</view>
		</view>
		<view v-else>
			<image src="../../../static/none.png" style="height: 260px;width: 260px;display: block;margin: 0 auto;padding-top: 50px;"></image>
			<view style="display: flex;justify-content: center;align-items: center;">
				暂无回单跟踪信息
			</view>
		</view>
		<view style="height: 50px;"></view>
	</div>
</template>

<script>
	import {
		receiptlogList
	} from '@/api/system/waybill.js'
	import myfilepicker from '@/components/uploadFile/uploadFile.vue'
	export default {
		components: {
			myfilepicker
		},
		props: {
			waybillId:{
				type: String,
				default:''
			}
		},
		data() {
			return {
				list:[],
				waybillId_:'',
				// 每页数据量
				pageSize: 10,
				// 当前页
				pageCurrent: 1,
				loading:false,
			}
		},
		watch: {
			waybillId(newValue, oldValue) {
				if(newValue)
				{
					this.waybillId_=newValue
					//this.getList()
				}
			},
		},
		methods: {
			async getList() {
				let data = {
					pageNum: this.pageCurrent,
					pageSize: this.pageSize,
					waybillId:this.waybillId_
				}
				this.loading = true
				await receiptlogList(data).then(res => {
					uni.hideLoading()
					if (res.code == '200') {
						this.list = res.rows
						this.total = res.total
						this.loading = false
					} else {
						uni.showToast({
							icon: 'none',
							title: res.msg
						})
					}
				})
			},
		},
	}
</script>

<style scoped>

</style>